﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Informacao : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["Email"] == null)
        {
        }
        else if (Session["Nivel"] == null) // É cliente
        {
            Literal lit = new Literal();
            lit.Text = "<h3>Funcionalidades</h3><ul class=\"bottom\"><li class=\"first\"><a href=\"SubmeterPedido.aspx\">Submeter Pedido</a></li><li><a href=\"InfoCliente.aspx\">Informação do Cliente</a></li></ul>";
            Menu_Default.Controls.Add(lit);
        }
        else if (Session["Nivel"].ToString().Equals("6"))
        {
            Literal lit = new Literal();
            lit.Text = "<h3>Funcionalidades</h3><ul class=\"bottom\"><li class=\"first\"><a href=\"SubmeterPedido.aspx\">Submeter Pedido</a></li><li><a href=\"RegistarCliente.aspx\">Registar Cliente</a></li><li><a href=\"ConsultarPlaneamentoGeral.aspx\">Consultar Planeamento Geral</a></li></ul>";
            Menu_Default.Controls.Add(lit);
        }
        else if (!Session["Nivel"].ToString().Equals("6"))
        {
            Literal lit = new Literal();
            lit.Text = "<h3>Funcionalidades</h3><ul class=\"bottom\"><li class=\"first\"><a href=\"ConsultarPlaneamentoPessoal.aspx\">Consultar Planeamento Pessoal</a></li><li><a href=\"ConsultarPlaneamentoGeral.aspx\">Consultar Planeamento Geral</a></li><li><a href=\"RegistarTarefas.aspx\">Registar Tarefas Realizadas</a></li></ul>";
            Menu_Default.Controls.Add(lit);
        }
    }

    protected void MensagemErro()
    {
        if (Session["Erro"] != null)
        {
            Literal lit = new Literal();
            lit.Text = "<ul id=\"menu2\"><li>" + Session["Erro"].ToString() + "</li></ul>";
            PanelMsg.Controls.Add(lit);
            Session["Erro"] = null;
        }
        if (Session["Sucesso"] != null)
        {
            Literal lit = new Literal();
            lit.Text = "<ul id=\"menu3\"><li>" + Session["Sucesso"].ToString() + "</li></ul>";
            PanelMsg.Controls.Add(lit);
            Session["Sucesso"] = null;
        }
    }
}